package com.algorithm.merger;/*
 *@Author:DOWN
 *@Date:2022/1/5 17:07
 *@Comment:
 */

public class SumArrs {

    private static int Sum(int[] arrs){
        return Sum(arrs,0);
    }

    private static int Sum(int[] arrs,int l){
        if(l==arrs.length){
            return 0;
        }
        return arrs[l]+Sum(arrs,l+1);
    }

    public static void main(String[] arrs){
        int[] items=new int[]{1,2,3,4,5,6,7,8,9};
        System.out.println(Sum(items));
    }
}
